import { requestIns } from '@/utils/request'
import { defineStore } from 'pinia'
import { ref } from 'vue'


export const useRolesStore = defineStore('roles', () => {
    const roles = ref([])

    const getRoles = async () => {
        const res = await requestIns.request('/role/index', 'get', {
            pagenum: 1,
            pagesize: 10000
        })
        roles.value = res.list
    }

    return {
        roles,
        getRoles
    }
}, {
    persist: true
})